<?php /* @var $user User */;?>
<?php use_helper('Date'); ?>
<div class="tabbed">
	<ul class="tabs">
		<li id="tab-profile_details" class="tab active">profile</li>
		<li id="tab-profile_keywords" class="tab">more info</li>
	</ul>

	<div id="profile_details" class="content">
		<div class="avatar">
			<?php echo image_tag($profile_user->getThumbnailUrl(), 'alt="'.$profile_user->getName().'"')?>
		</div>

		<dl class="group">
			<dt>Name:</dt>
			<dd><?php echo $profile_user->getName() ?></dd>
			<dt>Age:</dt>
			<dd><?php echo $profile_user->getAge() ?></dd>
			<dt>Gender:</dt>
			<dd><?php echo $profile_user->getGender() ?></dd>
			<dt>Roots / origin:</dt>
			<dd><?php echo $profile_user->getOrigin() ?></dd>
			<dt>Country:</dt>
			<dd><?php echo $profile_user->getCountry() ?></dd>
			<dt>My job / school:</dt>
			<dd><?php echo $profile_user->getOccupation() ?></dd>
			<dt>My favourite enemy:</dt>
			<dd><?php echo $profile_user->getEnemy() ?></dd>
		</dl>

		<?php if ($profile_user->getId() != $user->getId()): ?>
		<?php if(in_array($profile_user->getId(),$opposite_ids)): ?>
		<div class="is-perfect-opposite">This is one of your perfect opposites!</div>
		<?php else: ?>
		<div class="not-perfect-opposite">Not a perfect opposite</div>
		<?php endif; ?>
		<?php endif; ?>

		<p class="meta">
			<span class="text">Opposite ratio:</span>

			<?php
				$percentage = Round($user->getOppositenessWith($profile_user));
				$className  = Round($percentage/10)*10;
			?>
			<span class="oppositeness-<?php echo $className?> opposition"><?php echo $percentage?>%</span>

			<?php if ($profile_user->getId() != $user->getId()): ?>
			<?php if(in_array($profile_user->getId(),$opposite_ids)): ?>
			<span class="remove-perfect-opposite">Remove as perfect opposite</span>
			<?php else: ?>
			<span class="add-perfect-opposite">Add as perfect opposite</span>
			<?php endif; ?>
			<?php endif; ?>
		</p>
	</div>

	<div id="profile_keywords" class="content hide">
		<?php
			if ($profile_user->getKeywords()):
				$categories = Explode('#', $profile_user->getKeywords());
		
				foreach ($categories as $category):
					list($categoryName, $keywords) = explode('||', $category);
		?>
		<div>	
			<h4><?php echo $categoryName?></h4>
			<p><?php echo Str_Replace('|', ', ', $keywords)?></p>
		</div>	
		<?php endforeach; ?>
		<?php else: ?>
		<p>No keywords
		<?php endif; ?>
	</div>
</div>